package com.jiashihui.schema_lgorithm.schema.iterator;

/**
 * @author jiashihui
 * @describe: 迭代器模式测试类
 * @date 2019/03/15
 *
 * 顺序访问聚集中的对象
 */
public class IteratorTest {
    public static void main(String[] args) {
        Collection collection = new CollectionImpl();
        Iterator iterator = collection.iterator();
        while(iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
